/*
 * @Author: wuqingchun
 * @Date: 2024-09-23 21:05:41
 * @Description: 
 * @LastEditors: wuqingchun
 * @LastEditTime: 2024-09-24 14:15:33
 */
#ifndef __CHAT_DB_MYSQL_H__
#define __CHAT_DB_MYSQL_H__

#include <string>
#include <mysql/mysql.h>

class CChatDBMysql
{
public:
    static CChatDBMysql& GetInstance();

public:
    int32_t Init();

    /**
     * @brief 执行 SQL 语句
     * 
     * @param refSql 
     * @return int32_t 
     */
    int32_t ExecuteSQL(const char* pcSQL, MYSQL_RES** pstResult = nullptr);

private:
    
    CChatDBMysql();
    ~CChatDBMysql();

    
private:
    MYSQL* m_pstMysqlConn = nullptr;
};

#endif //__CHAT_DB_MYSQL_H__